#include "Triangle.h"

Triangle::Triangle(){
	vertices=new D3DVERTEX[4]();
	Shape::Create(0,0,0,0,false,"",3,D3DPRIMITIVETYPE::D3DPT_TRIANGLESTRIP,NULL);
}

Triangle::Triangle(float x,float y, float sizeX,float sizeY,DWORD color,bool visible,char* name){
	vertices=new D3DVERTEX[4]();
	vertices[0].x = x; 
	vertices[0].y = y-sizeY/2; 
	vertices[0].z = 0; 
	vertices[0].rhw = 1.0f; 
	vertices[0].color=color;

	vertices[1].x = x+sizeX/2; 
	vertices[1].y = y+sizeY/2; 
	vertices[1].z = 0; 
	vertices[1].rhw = 1.0f; 
	vertices[1].color=color;

	vertices[2].x = x-sizeX/2; 
	vertices[2].y = y+sizeY/2; 
	vertices[2].z = 0; 
	vertices[2].rhw = 1.0f;
	vertices[2].color=color;

	Shape::Create(x,y,sizeX,sizeY,visible,name,3,D3DPRIMITIVETYPE::D3DPT_TRIANGLESTRIP,vertices);
}
void Triangle::Draw(Renderer* renderer){	
	Shape::Draw(renderer);
}